﻿using System;
using Hx.WebSite;
using Hx.WebSite.WebApi.Authorization;
using Microsoft.Owin;
using Microsoft.Owin.Security.OAuth;
using Owin;

[assembly: OwinStartup(typeof(Startup))]

namespace Hx.WebSite
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            var oAuthOptions = new OAuthAuthorizationServerOptions
            {
                TokenEndpointPath = new PathString("/token"),
                Provider = new HaoXueOAuthAuthorizationServerProvider(),
                AccessTokenExpireTimeSpan = TimeSpan.FromSeconds(120),
                AllowInsecureHttp = true
            };

            app.UseOAuthBearerTokens(oAuthOptions);
        }
    }
}
